<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>我的支付</title>
		<link rel="stylesheet" type="text/css" href="../../css/mui.min.css">
		<link rel="stylesheet" type="text/css" href="../../css/api.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/base.css">
		<style>
			body {
			}
		 .mui-media-object1 {
				line-height: 80px;
				width: 140px;
				height: 80px;
				border-radius: 2px;
				overflow: hidden;
				margin-right: 10px;
			}
			.train-title {
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
			}
			.hot-train-time {
				margin-top: 10px;
				color: #FE9400;
				/*background-size: 20px;
				 background-image: url(../../image/icon_cmp_xuiqiu.png);
				 background-position: center left;
				 background-repeat: no-repeat;*/
			}
			.hot-train-title {
				margin-top: 5px;
				height: 42px;
			}
			.noSign img {
				max-width: 110px;
				display: inline-block;
			}
			.noSign {
				left: 0;
				top: 0;
				margin: 0 auto;
				text-align: center;
				padding: 140px 20px;
				width: 100%;
			}
		</style>
	</head>
	<body>
	<ul class="mui-table-view" id="item">
			<!--<li class="mui-table-view-cell mui-media">
				<img class="mui-media-object mui-pull-left" src="../../image/course_placehoder.png">
				<div class="hot-train-title-div">
					<p class="base_black_grey base_content_font train-title hot-train-title ">
						第三家学霸赛分析报告表嘎嘎嘎第三家学霸赛分家学霸赛分家学霸赛分家学霸赛分
					</p>
					<p class=" base_tag_font hot-train-time">
						￥120.00
					</p>
				</div>
			</li>
			<li class="mui-table-view-cell mui-media">
				<img class="mui-media-object mui-pull-left" src="../../image/course_placehoder.png">
				<div class="hot-train-title-div">
					<p class="base_black_grey base_content_font train-title hot-train-title">
						第三家学霸赛
					</p>
					<p class=" base_tag_font hot-train-time">
						￥120.00
					</p>
				</div>
			</li>
			<li class="mui-table-view-cell mui-media">
				<img class="mui-media-object mui-pull-left" src="../../image/course_placehoder.png">
				<div class="hot-train-title-div">
					<p class="base_black_grey base_content_font train-title hot-train-title">
						第三家学霸赛分析报告表嘎嘎嘎第三家
					</p>
					<p class=" base_tag_font hot-train-time">
						￥120.00
					</p>
				</div>
			</li>-->
		</ul>
		<div class="noSign" hidden="hidden" id="noData" style="background-color: #ffffff;" >
			<img src="../../image/icon_no_pay.png" width="60%">
			<p class="font16 top_15 base_dark_grey" >
				您还没有支付订单
			</p>
		</div>
		<div class="loadFailure" hidden="hidden" id="noNet" style="background-color: #ffffff;">
			<img src="../../image/icon_img01.png" width="60%">
			<p class="" >
				数据加载失败
			</p>
			<p>
				请检查您的网络
			</p>
			<button type="button"  onclick="loadData()"class="mui-btn mui-btn-outlined">
				重新加载
			</button>
		</div>
	</body>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript">
		var page = 1;
		var row = 10;
		var refreshCount = 0;
		apiready = function() {
            SendBehaviorTrajectoriesNotifi1(0, '我的支付', '172',api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname,  document.title);
			loadData();
			setRefreshHeader();
			setPullUpRefresh();
		};
		function loadNewData() {
			page = 1;
			loadData();
		}

		function loadMoreData() {
			page++;
			loadData();
		}

		function loadData() {
			showProgress();
			var params = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				sjid : $api.getStorage('cfnetppjid'),
				page :page,
				rows :row
			};
//			 alert("params=="+JSON.stringify(params))
			cfnetppPOST(url_mypurchase, params, true, function(data, status) {
				api.hideProgress();
//				alert(JSON.stringify(data))
				api.refreshHeaderLoadDone();		
				if (status == 'success') {
					if (data.code == 200) {
						$('#item').show();
						var list = data.data;
						sethtmls(list,list.length);
					} else {
						if (page == 1) {
							$('#noData').show();
							$('#noNet').hide();
							$('#item').hide();
						}
					}
				} else {
					$('#item').hide();
					$('#noData').hide();
					$('#noNet').show();
				}
			});
		}
		function  sethtmls(datas,len){
		    var phtmls = '';
			for(var i = 0; i < len; i++){
			var data = datas[i];
			 var phtml = '<li class="mui-table-view-cell mui-media" onclick=openhd('+"'"+data.titel+"'"+","+"'"+data.detail+"'"+","+"'"+data.types+"'"+","+"'"+data.subtype+"'"+","+"'"+data.cid+"'"+","+"'"+data.image+"'"+')>'+
				'<img class="mui-media-object1 mui-pull-left" src="'+data.image+'">'+
				'<div class="hot-train-title-div">'+
					'<p class="base_black_grey base_content_font train-title hot-train-title ">'+
						data.titel+
					'</p>'+
					'<p class=" base_tag_font hot-train-time">￥'+
					   data.money+
					'</p>'+
				'</div>'+
			'</li>';
			 phtmls = phtmls+phtml;
			}	
		  $("#item").html(phtmls);
		  
		}
		/**
		 *
		 * //types支付产品类型（1、物流师题库教材；2、学习频道；3、天津培训包课程；4、导师online课程；5、课程频道；6、认证频道 8、学霸赛分析报告购买）
             //subtype子类型（一、学习频道（1、精品课程；2、Mooc课程；3、学习任务知识点）二、认证（1、报名费；2、考试费））
		 * 
		 * types支付产品类型（5、课程频道；6、认证频道 8、学霸赛分析报告购买）
          //二、认证（1、报名费；2、考试费））
		 * 
		 * 
		 *  */
		
		
		function openhd(title, detail,types,subtype,cid,im,image) {
			SendBehaviorTrajectoriesNotifi1(1, '我的支付', '172',api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname,  document.title);
		  	var winName;
		   var winPath;
		   var pageParam;
		   if (detail != '' && detail != null && detail != undefined){//带连接的
		          winName ='indexLunDetailsWindow',
			        winPath = '../HomePage/indexLunDetailsWindow.html',
					 pageParam = {
					 url :  detail,
					 sourceurl : window.location.pathname,
					 sourcetitle : document.title,
					 ctitle : title,
					 title : title,
					 shareurl :detail
				    }			
				}else if(types == 5) {//学习频道
				  winName ='Teacher_StudyCourseInfo',
			      winPath = '../Teacher_Teach/Teacher_StudyCourseInfo.html',
			      pageParam = {
				    sourceurl : window.location.pathname,
					sourcetitle : document.title,
					imgurl:image,
					title :title,
					planid:"",
					courseid:cid,
					cstatus:"0",
					selected:"1",
					part:"455",
					coursename:title,
					userType:"student",
					coverimages:image,
					isxueba:"0"
				  };
				
				}else if(types == 6) {//认证频道
				   winName ='CertificationForm.html',
			      winPath = '../../CertificationForm.html',
			      pageParam = {
			         type :1,
					sourceurl : window.location.pathname,
					sourcetitle : document.title,
				  };
				}
			api.openWin({useWKWebView:true,
		    name: winName,
		    url: winPath,
		    pageParam: pageParam
		  });	
			
		}
		
		
	</script>
</html>